﻿using BarManager.Core.BusinessRules.Interfaces.Validator;
using BarManager.Core.BusinessRules.Specification;
using BarManager.Core.DomainService;
using BarManager.Core.Entity;

namespace BarManager.Core.BusinessRules.Validator
{
    public class OrdenValidator : BaseValidator<Orden>, IOrdenValidator
    {
        public OrdenValidator(IOrdenRepository repository, IMesaRepository mesaRepository,
            IProductoRepository productoRespository)
        {
            Rules.Add(new Rule<Orden>(ValidatorType.Add, new MesaEstaLibre(repository, mesaRepository)));
            Rules.Add(new Rule<Orden>(ValidatorType.Add, new OrdenAddSpecification(repository, productoRespository)));
            Rules.Add(new Rule<Orden>(ValidatorType.Update, new OrdenUpdateSpecification(repository, productoRespository)));
        }
    }
}
